/*
 * Copyright (C) 2009 Otávio Scherer Garcia
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.googlecode.technorati4j.entity;

import org.jdom.Element;

/**
 * Member information.
 * 
 * @author Otávio Scherer Garcia
 * @version $Revision$
 */
public final class Member {

    /**
     * The member username.
     */
    private String username;

    /**
     * The first name.
     */
    private String firstname;

    /**
     * The last name.
     */
    private String lastname;

    /**
     * URL to thumbnail picture
     */
    private String thumbnailPicture;

    public Member(Element element) {
        username = element.getChildText("username");
        firstname = element.getChildText("firstname");
        lastname = element.getChildText("lastname");
        thumbnailPicture = element.getChildText("thumbnailpicture");
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getThumbnailPicture() {
        return thumbnailPicture;
    }

    public void setThumbnailPicture(String thumbnailPicture) {
        this.thumbnailPicture = thumbnailPicture;
    }

    @Override
    public String toString() {
        final StringBuilder str = new StringBuilder();
        str.append("(username=");
        str.append(this.username);
        str.append("&firstname=");
        str.append(this.firstname);
        str.append("&lastname=");
        str.append(this.lastname);
        str.append("&thumbnailPicture=");
        str.append(this.thumbnailPicture);
        str.append(")");

        return str.toString();
    }

}
